// Bottom of page
function allStuff() {
	var $window = $(window),
		$body = $('body'),
		$dataAuthor = $('[data-author="Najwa Rahman$"]'),
		$topLink = $('#top'),
		$checkerBox = $('#reader'),
		$viewPort = $('html, body'),
		$ulSpy = $('ul.spy'),
		$blogStatus = $('#status'),
		$updateBoard = $blogStatus.find('#pengumuman'),
		$nav = $('#taufik'),
		$shockElem = $body.find('*'),
		$pageLoader = $('#page-loader'),
		$openFrame = $('.openFrame'),
		$myComments = $('#comments'),
		$commentBlock = $myComments.find('#cm_block'),
		$ansButton = $('.answer-this-comment'),
		$commentForm = $('#comment-form'),
		$commentEditor = $('#comment-editor'),
		$commentVideo = $myComments.find('.video'),
		$fiddleScreen = $('.jsfiddle-demo'),
		$codeRef = $('.post > code, div > code, section > code'),
		$myDescription = $('abbr, acronym'),
		$emoBar = $('#respond p b'),
		$sidebarWrapper = $('#sidebar-wrapper'),
		$labelWidget = $sidebarWrapper.find('#Label1'),
		$togglePre = $('#togglePre'),
		$topRibbon = $('#top-ribbon'),
		$searchBox = $('#cse-search-box'),
		$subscribeForm = $topRibbon.find('#subscribeform'),
		$subscribeButton = $('.subscribe'),
		$closeForm = $('.closeform'),
		$opener = $('#openab'),
		$closer = $('#closeab'),
		$aboutPanel = $('#about'),
		$fadeElem = $('#cse-search-box, .iklan-banner, #main, #reader, #alexa'),
		$slideElem = $('#header, #main-wrapper, #sidebar-wrapper, #iklan-wrapper, .sidebarbox'),
		alertImg = "file:///D:/Backup%20Penting/Logo/Logo%20DTE/dte-w-knife.png",
		$alertBox, $loadingText;

	// Some elements...
	$body.removeClass('init').append('<div id="alert-box" class="hidden"><div class="message"></div></div><span id="loadingtext"></span>').on("click", function() {
		$('.emoKey').remove();
	});
	$alertBox = $('#alert-box');
	$loadingText = $('#loading-text');
	// Rewrite my old blog author name
	$('.cm_name a:contains(Tukang Pos)').html('Taufik Nurrohman').closest('.cm_entry').prepend('<span class="author-mark"></span>');
	// Emoticon dialog
	$emoBar.one("click", function() {
		$alertBox.fadeIn(600).children().html('Untuk menyisipkan emotikon setidaknya Anda harus menambahkan satu spasi di depan. Jangan pernah melupakan itu atau emotikon Anda tidak bisa diterjemahkan<div class="button-group"><button class="close">OK</button></div>');
	});
	$alertBox.on("click", ".close", function() {
		$alertBox.fadeOut();
	});
	// View my Profile
	function viewProfile() {
		$('#taufik li ul').slideUp();
		$topRibbon.stop().animate({top:-350}, 700, function() {
			$fadeElem.fadeOut(700, function() {
				$aboutPanel.slideDown(1000, function() {
					$(this).animate({width:"60%"}, 600);
				});
				$slideElem.slideUp(1000);
			});
		});
	}
	function hideProfile() {
		$fadeElem.fadeIn(700, function() {
			$topRibbon.stop().animate({top:0}, 600, function() {
				$aboutPanel.animate({width:"90%"}, 600, function() {
					$(this).slideUp(700);
				});
			});
		});
	}
	$opener.on("click", function() {
		if ($window.scrollTop() > 100) {
		$viewPort.stop().animate({scrollTop:0}, 'slow', viewProfile);
		} else {
			viewProfile();
		}
		return false;
	});
	$closer.on("click", function() {
		$slideElem.slideDown(1000, hideProfile);
		return false;
	});
} allStuff();
